package com.xianbeiying.app.ckgl.activity;

import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.xianbeiying.app.ckgl.R;
import com.xianbeiying.app.ckgl.fragment.VaFragmentss;

/**
 * 风机和卷帘
 * */
public class VaorRbActivity extends BaseActivity {
  //  RadioGroup vaorb_group;
  //  RadioButton ask_va;
    private ImageView iv_vaorb_left;
    //标题
    private TextView tv_title;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vaor_rb);
        init();
    }
    private void init(){
   //     vaorb_group=(RadioGroup)findViewById(R.id.vaorb_group);
   //     ask_va=(RadioButton)findViewById(R.id.ask_va);
        //标题
        tv_title = (TextView) findViewById(R.id.tv_title);
        tv_title.setText("风机");
        iv_vaorb_left=(ImageView) findViewById(R.id.iv_vaorb_left);
    //    ask_va.setChecked(true);
        getSupportFragmentManager().beginTransaction().
                replace(R.id.ly_varb,VaFragmentss.getInstance()).commit();
        enevt();
        iv_vaorb_left.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
    private void enevt(){
    //    vaorb_group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
     //       @Override
     //       public void onCheckedChanged(RadioGroup group, int checkedId) {
                //风机
      //          if (checkedId == R.id.ask_va) {
                    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
                    transaction.replace(R.id.ly_varb, VaFragmentss.getInstance());
                    transaction.commit();
                }
                //卷帘
       //         else if (checkedId == R.id.ask_rb) {
        //            FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
//                    transaction.replace(R.id.ly_varb, RbFragment.getInstance());
         //           transaction.commit();
        //        }
        //    }
      //  });
  //  }
}
